<%@page import="com.gohi.main.util.Utils"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!doctype html>
<html >

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta content="telephone=no" name="format-detection" >
<meta name="renderer" content="webkit">
<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
<link rel="stylesheet" type="text/css" href="http://cdn.amazeui.org/amazeui/2.2.1/css/amazeui.min.css">

<title>测试支付</title>
</head>
<body >
<header data-am-widget="header" class="am-header am-header-default">
  <div class="am-header-left am-header-nav">
    <a href="#left-link" class="">
      <i class="am-header-icon am-icon-home"></i>
    </a>
  </div>
  <h1 class="am-header-title">
    <a href="#title-link" class="">格新信息技术</a>
  </h1>
  <div class="am-header-right am-header-nav">
    <a href="#right-link" class="">
      <i class="am-header-icon am-icon-bars"></i>
    </a>
  </div>
</header>
<br/><br/>
<div style="text-align: center;">
  <button type="button"  name="ajaxLoadId"  id="test" onclick="testpay()" class="am-btn am-btn-secondary am-round">测试支付</button>
    <button type="button"  id="getloc" class="am-btn am-btn-secondary am-round">地理位置</button>
  <button type="button"  onclick="javascript:window.location.reload()" class="am-btn am-btn-secondary am-round">刷新</button>
  
  
  
</div>

  <footer data-am-widget="footer" class="am-footer am-footer-default" data-am-footer="{  }">
  <div class="am-footer-switch">
    <span class="am-footer-ysp" data-rel="mobile" data-am-modal="{target: '#am-switch-mode'}">云适配版</span>
    <span class="am-footer-divider">|</span>
    <a id="godesktop" data-rel="desktop" class="am-footer-desktop"
    href="javascript:">电脑版</a>
  </div>
  <div class="am-footer-miscs ">
    <p>由
      <a href="" title="" target="_blank" class="">格新技术</a>提供技术支持</p>
    <p>CopyRight©2014 AllMobilize Inc.</p>
    <p>沪ICP备13033158</p>
  </div>
</footer>
<div id="am-footer-modal" class="am-modal am-modal-no-btn am-switch-mode-m am-switch-mode-m-default">
  <div class="am-modal-dialog">
    <div class="am-modal-hd am-modal-footer-hd">
      <a href="javascript:void(0)" data-dismiss="modal" class="am-close am-close-spin "
      data-am-modal-close>&times;</a>
    </div>
    <div class="am-modal-bd">您正在浏览的是
      <span class="am-switch-mode-owner">云适配</span>
      <span class="am-switch-mode-slogan">XXXX</span>
    </div>
  </div>
</div>
    <script type="text/javascript">
	var  obj =${alert};
	//alert(obj)
	$("#test").one("click",function(){ 
	WeixinJSBridge.invoke('getBrandWCPayRequest',{
            "appId" : obj.appId,    //公众号名称，由商户传入
            "timeStamp":obj.timeStamp,//时间戳，自 1970 年以来的秒数
            "nonceStr" : obj.nonceStr, //随机串
            "package" : obj.packageValue,
            "signType" : obj.signType,          //微信签名方式:
            "paySign" : obj.paySign    //微信签名
            },function(res){                
            if(res.err_msg == "get_brand_wcpay_request:ok" ) {
                alert("充值成功感谢支持！");
                window.location.reload()
                //window.location.href=obj.sendUrl;
            }else{
                alert("充值失败！");
				//window.location.href="http://183.33.212.175:8016/wxweb/config/oauth!execute.action";
            }
        });
		
	})

	 var share = {
		id:1,//公众号对应的ID
	    img_url:"http://www.51itlink.com/upload/image/20150215/1423964444177097915.jpg", //分享的小图片地址
		link:window.location.href, //分享出去的链接
	    desc: "研发部-测试分享",
	    title: "研发部-测试分享",//分享的内容标题
	    type: '', // 分享类型,music、video或link，不填默认为link
	    dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
	   	success:function(){
	   		alert("分享成功");
	   	}
	};

$("#getloc").click(function(){
	wx.getLocation({
	    success: function (res) {
	        var latitude = res.latitude; // 纬度，浮点数，范围为90 ~ -90
	        var longitude = res.longitude; // 经度，浮点数，范围为180 ~ -180。
	        var speed = res.speed; // 速度，以米/每秒计
	        var accuracy = res.accuracy; // 位置精度
	        alert(latitude)
	    }
	});


	
})

</script>
<!-- 下面代码放到最后 -->
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script> 
<script type="text/javascript" src="/js/wx/sharp.js?a=df"></script> 

<script type="text/javascript" src="http://cdn.amazeui.org/amazeui/2.2.1/js/amazeui.min.js"></script>
<script type="text/javascript" src="http://cdn.amazeui.org/amazeui/2.2.1/js/amazeui.legacy.min.js"></script>
  </body>


</html>